#!/bin/bash

echo "blacklist wireless" > /etc/modprobe.d/blacklist-wireless.conf
echo "blacklist cfg80211" >> /etc/modprobe.d/blacklist-wireless.conf
echo "blacklist mac80211" >> /etc/modprobe.d/blacklist-wireless.conf

rmmod mac80211 2>/dev/null
rmmod cfg80211 2>/dev/null
rmmod wireless 2>/dev/null

if command -v nmcli &>/dev/null; then
    nmcli radio wifi off 2>/dev/null
fi

for iface in $(ip link show | grep -E "wlan|wlp|wifi" | cut -d: -f2 | tr -d ' '); do
    ip link set "$iface" down 2>/dev/null
done

echo "无线接口已禁用"
